package com.ddxz.photovoltaic.task;

import com.ddxz.photovoltaic.service.SyncDataService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * class description
 *
 * @author 朱宗刚
 * @version 1.0.0
 * @date 2022/8/26
 */

@Component
public class SyncDataTask {
    public SyncDataTask(SyncDataService service) {
        this.service = service;
    }

    @Scheduled(cron = "0 0/5 * * * ?")
    public void startSyncData() {
        service.syncData();
    }

    private final SyncDataService service;
}
